<!--
 * @Author: HeAo
 * @Date: 2021-10-08 10:23:42
 * @LastEditTime: 2021-10-08 11:10:09
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2105\3-2-Vue\day01\2-生命周期.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.13/vue.js"></script>
</head>

<body>
  <div id="app">
    {{msg}}
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello vue'
      },
      methods: {
        findAllCategories() {
          console.log('查询所有栏目信息');
        }
      },
      beforeCreate() {
        console.log('before create');
        // console.log(this.msg);
      },
      created() {
        console.log('created');
        // console.log(this.msg);
        // this.findAllCategories()
      },
      beforeMount() {
        console.log('before mount');
      },
      mounted() {
        console.log('mounted');
        setTimeout(() => {
          this.msg = 'edit vue'
        }, 3000)
      },
      beforeUpdate() {
        console.log('beforeUpdate');
      },
      updated() {
        console.log('updated');
      },
      beforeDestroy() {
        console.log('destory');
      },
      destroyed() {
        console.log('destoryed');
      }
    })
  </script>
</body>

</html>